package com.lyloou.server;

import com.alibaba.fastjson.JSON;

public class JSONSerializer implements Serializer {


    @Override
    public byte[] serialize(Object object) {
        byte[] bytes = JSON.toJSONBytes(object);
        return bytes;
    }


    @Override

    public <T> T deserialize(Class<T> clazz, byte[] bytes) {

        return JSON.parseObject(bytes, clazz);

    }

}